import urllib.request
import urllib.error


url = 'https://blog.csdn111.net/m0_63947499/article/details/1369111211'
# UA 信息
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 '
                  'Safari/537.36'
}

try:
    # 定义请求
    request = urllib.request.Request(url=url, headers=headers)
    # 发送请求
    response = urllib.request.urlopen(request)

    # 编解码
    content = response.read().decode('utf8')

    print(content)
except urllib.error.HTTPError:
    print('系统正在升级****')
except urllib.error.URLError:
    print('1111')
